<template>
  <Tabs :animated="false">
    <template v-for="(tab, index) in bTabs">
      <TabPane :key="index" :label="tab.label" :name="tab.name" >
        <keep-alive>
          <component :is="tab.component" />
        </keep-alive>
      </TabPane>
    </template>
  </Tabs>
</template>

<script>
import bottomTabs from './tabs/uBottomTabs'
import merge  from 'lodash/merge'
import update from 'lodash/update'

export default {
  data() {
    return {
    };
  },
  computed: {
    bTabs:()=>{
      return Object.values(bottomTabs)
    }
  },
  methods:{
    upper(name,label){
      let attr={
            label:label,
        }
      update(bottomTabs,name ,tab=>merge(tab,attr))
    }
  },
  created(){ 
    this.upper('hardCfg','串口配置表')
    this.upper('uartControl','串口开关')
    this.upper('uartSend','发送面板')
    this.upper('messageBase','信息库')
  },
};
</script>

<style>
.ivu-tabs.ivu-tabs-no-animation > .ivu-tabs-content {
  height: 100%;
  margin-top: -16px;
}

</style>